<?php	/* gmslOpenSource 2008 */
/*
----------------------------------------------------------------------------------------
	Project name:		gmslappcore
	Section:		connector
----------------------------------------------------------------------------------------
	Script name:		connection.php
	Script location:	./gmslappcore/connector/
	Script version:		1.2
----------------------------------------------------------------------------------------
	Script info:		This script will be automaticly included with every
				page that uses the gmslappcore system, regardless of
				whether that page needs a connection to a database.
	Script dependencies:
 				~The database section of the config file must be set
 				up correctly, otherwise errors will occur.
----------------------------------------------------------------------------------------
	This script is part of the gmslappcore system which is released
	under the GNU licese.
	Copyright: 2008 Andrew Cornford (groupmsl.co.uk)
	Email: projects@groupmsl.co.uk
	Website: www.groupmsl.co.uk?section=cms&page=view&t=gmslappcore&f=groupmsl Open Source/gmslappcore
----------------------------------------------------------------------------------------
	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
----------------------------------------------------------------------------------------
*/
$sql_connection=mysql_connect($settings['sql_host'],$settings['sql_username'],$settings['sql_password']);
if(!$sql_connection) include($errors['location'].'database_connect_error.php');
mysql_select_db($settings['sql_database'],$sql_connection)or die("Sorry but ".$settings['organisation']." could not connect you to the mysql database. We should be back up and running soon.");
$database['users']="gmslappcore_users_".$settings['sql_table_name'];
if($settings['error_messages']=='appcore') $errors['location']=$settings['gmslappcore_location'].'errors/';
else $errors['location']='./gap_user_files/errors/';
$settings['system_version']="gmslappcore v3.0.0D";
?>
